A web service is a method of communication between computer systems via the web. For example, applications running on different computer systems may communicate with each other via the web using a web service. Web services may be implemented using Simple Object Access Protocol (SOAP), which is a protocol that provides mechanisms for exchanging structured information between computer systems. SOAP uses the Extensible Markup Language (XML) Information Set for its message format, and relies on application layer protocols (e.g., Hypertext Transfer Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), etc.) for message negotiation and transmission.
In order for a web service client (executing at one computer system) to communicate with a web service provider (executing at another computer system) via the web, the web service client (herein referred to simply as the “service client”) instantiates a web service stub (herein referred to simply as a “service stub”). As used herein, a “service stub” refers to an object which is responsible for connecting and communicating with a web service skeleton (herein referred to simply as a “service skeleton”) which is an object has been instantiated at the web service provider (herein referred to simply as the “service provider”).
By way of example, when a client application (e.g., a backup client application) executing at a service client needs to request a server application (e.g., a backup server application) executing at a service provider to perform a service (e.g., backup data from a source storage system to a target storage system), the service client must first perform a web service call to the service provider. As used herein, “performing a web service call” refers to a service stub of a service client exchanging messages with a service skeleton of a service provider in order to establish a connection between themselves. Once the connection is established, the client application may send service requests (e.g., backup requests) to the server application via the established connection. For example, the client application sends a service request to the service stub, which in turn, transmits it to the service skeleton. The service skeleton, in response to receiving the service request, sends it to the server application. The server application performs the requested service (e.g., the requested backup), and may provide some information (e.g., statuses, etc.) to the service skeleton, which in turn transmits it to the service stub at the service client. The service stub then sends the information to the client application which called (i.e., invoked) the service.
Multiple client applications may each perform a web service call (i.e., connect) to the same service provider, each using its own software thread. Conventionally, when multiple client applications connect to the same service provider, the service client instantiates a single service stub, and this single service stub is shared by all the threads. Such a non-thread safe usage of the service stub is problematic because the data exchanged between the service client and the service provider may be corrupted. For example, the input and/or output buffers associated with the service stub may contain data from multiple threads, rendering the data unusable by any thread.